<div class="alert alert-info">
    <h4>Daftar Penduduk</h4>
</div>
<div class="row-fluid">
    <div class="span2">
        <p><?php echo anchor('petugas/nik', '<button class="btn btn-primary" type="submit"><i class="icon-plus icon-white"></i> Tambah</button>'); ?></p>
    </div>
    <div class="span2">
        <p><?php echo anchor('petugas/nik_baru', '<button class="btn btn-primary" type="submit"><i class="icon-plus icon-white"></i> Baru</button>'); ?></p>
    </div>
    <div class="control-group">
        <div class="controls">
            <div class="input-append">
                <?php
                $att = array(
                    'class' => 'form-vertical'
                );
                echo form_open('petugas/result', $att);
                ?>
                <input id="appendedInputButton" class="span2" type="text" size="16" name="search">
                <button class="btn" type="submit">Cari!</button>
                <?php echo form_close() ?>
            </div>
        </div>
    </div>

</div>
<?php
if (empty($pndk)) {
    echo '<div class ="alert alert-error">Tidak ada data Penduduk</div>';
} else {
    ?>
    <div class="row-fluid">
        <div class="span8">
            <div class="row-fluid">
                <table class="table table-striped table-bordered table-condensed">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>No. KK</th>
                            <th>NIK</th>
                            <th>Nama</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $no = 1; ?>
                        <?php foreach ($pndk as $pd) : ?>
                            <tr>
                                <td><?php echo $no ?></td>
                                <td><a href="<?php echo site_url() ?>/detail/kk/<?php echo $pd->kk_id ?>"><?php echo $pd->kk_id ?></a></td>
                                <td><a href="<?php echo site_url() ?>/detail/nik/<?php echo $pd->nik ?>"><?php echo $pd->nik ?></a></td>
                                <td>
                                    <?php
                                    $nik = $pd->nik;
                                    $nama = $pd->nama;
                                    echo anchor('detail/nik/' . $nik, $nama);
                                    ?>
                                </td>
                                <td><?php echo anchor('petugas/edit_nik/'.$pd->nik,'<i class="icon-pencil tool"></i>') ?> | <?php echo anchor('detail/del_nik/'.$pd->nik,'<i class="icon-remove tool"></i>') ?></td>
                            </tr>
                            <?php $no++ ?>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div><!--/row-->
        </div><!--/span-->
    </div>
    <?php
}?>